package com.up.upzl.biz.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.up.upzl.base.domain.BaseDomain;

import lombok.Getter;
import lombok.Setter;

/**
 * 地区
 * 
 * @author geeks
 *
 */
@Getter
@Setter
@Entity
public class Area extends BaseDomain {

	private static final long serialVersionUID = 6011482191823079346L;

	/**
	 * 地区名称
	 */
	private String name;

	/**
	 * 父级地区
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid")
	private Area parentArea;

	/**
	 * 子级地区
	 */
	@OneToMany(mappedBy = "parentArea")
	private List<Area> subAreas;
}
